package com.czmh.etc.onlinepubsys.feign.newrun;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.czmh.etc.onlinepubsys.feign.newrun.constans.NewrunConstants;
import com.czmh.etc.onlinepubsys.json.JsonResult;

/**
 * @ClassName：SsoClient
 * @Description：粤通卡开发服务
 * @Author： sevenchen.
 * @Date：2019/10/16 16:29.
 * @Version：1.0.0
 */
@FeignClient(name = "SsoClient",
        url = NewrunConstants.FETCH_DOMAIN + "/api/sso/",
        fallback = SsoClient.DefaultFallback.class
)
public interface SsoClient {

    /**
     * 通过手机号+用户来源登录
     * @param mobile            手机号
     * @param unionId        用户来源，固定传17
     * @return
     */
    @PostMapping(value = "login")
    JsonResult login(@RequestParam String mobile, @RequestParam String unionId);
    
    /**
     * 退出登录
     * @param mobile            手机号
     * @return
     */
    @PostMapping(value = "outlogin")
    JsonResult outlogin(String mobile);


    public class DefaultFallback implements SsoClient {
        @Override
        public JsonResult login(String mobile, String unionId) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public JsonResult outlogin(String mobile) {
            // TODO Auto-generated method stub
            return null;
        }
    }
}
